---
layout: "default"
title: "readLine"
description: "Swift documentation for 'readLine': Returns Characters read from standard input through the end of the
current line or until EOF is reached, or nil if EOF has already been
reached."
keywords: "readLine,func,swift,documentation"
root: "/v2.0"
---

<div class="declaration" id="func-readline-stripnewline_-bool">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-readline-stripnewline_-bool">func readLine(<wbr>stripNewline: Bool)</a>
        
<div class="comment collapse" id="comment-func-readline-stripnewline_-bool"><div class="p">
    <p>Returns <code>Character</code>s read from standard input through the end of the
current line or until EOF is reached, or <code>nil</code> if EOF has already been
reached.</p>

<p>If <code>stripNewline</code> is <code>true</code>, newline characters and character
combinations will be stripped from the result.  This is the default.</p>

<p>Standard input is interpreted as <code>UTF-8</code>.  Invalid bytes
will be replaced by Unicode <a href="http://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character">replacement characters</a>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func readLine(stripNewline stripNewline: Bool = default) -&gt; String?</code>
    
    
</div></div>
</div>
